.class public Lcom/xingbook/park/view/d;
.super Landroid/view/View;

# interfaces
.implements Landroid/view/animation/Animation$AnimationListener;


# instance fields
.field private a:I

.field private b:I

.field private c:I

.field private d:I

.field private e:F

.field private f:I

.field private g:I

.field private h:F

.field private i:I

.field private j:Landroid/graphics/Paint;

.field private k:Lcom/xingbook/park/view/e;

.field private l:Landroid/graphics/PaintFlagsDrawFilter;

.field private m:Landroid/graphics/RectF;

.field private n:Lcom/xingbook/park/view/f;


# direct methods
.method public constructor <init>(Landroid/content/Context;FFIII)V
    .locals 3

    const/4 v2, 0x0

    invoke-direct {p0, p1}, Landroid/view/View;-><init>(Landroid/content/Context;)V

    iput v2, p0, Lcom/xingbook/park/view/d;->f:I

    const/16 v0, 0x64

    iput v0, p0, Lcom/xingbook/park/view/d;->g:I

    const/4 v0, 0x0

    iput v0, p0, Lcom/xingbook/park/view/d;->h:F

    const/high16 v0, -0x100

    iput v0, p0, Lcom/xingbook/park/view/d;->i:I

    new-instance v0, Landroid/graphics/Paint;

    invoke-direct {v0}, Landroid/graphics/Paint;-><init>()V

    iput-object v0, p0, Lcom/xingbook/park/view/d;->j:Landroid/graphics/Paint;

    new-instance v0, Landroid/graphics/PaintFlagsDrawFilter;

    const/4 v1, 0x3

    invoke-direct {v0, v2, v1}, Landroid/graphics/PaintFlagsDrawFilter;-><init>(II)V

    iput-object v0, p0, Lcom/xingbook/park/view/d;->l:Landroid/graphics/PaintFlagsDrawFilter;

    iput p2, p0, Lcom/xingbook/park/view/d;->e:F

    iput p3, p0, Lcom/xingbook/park/view/d;->h:F

    iput p5, p0, Lcom/xingbook/park/view/d;->a:I

    iput p6, p0, Lcom/xingbook/park/view/d;->b:I

    iput p4, p0, Lcom/xingbook/park/view/d;->i:I

    new-instance v0, Landroid/graphics/RectF;

    invoke-direct {v0}, Landroid/graphics/RectF;-><init>()V

    iput-object v0, p0, Lcom/xingbook/park/view/d;->m:Landroid/graphics/RectF;

    new-instance v0, Lcom/xingbook/park/view/e;

    invoke-direct {v0, p0}, Lcom/xingbook/park/view/e;-><init>(Lcom/xingbook/park/view/d;)V

    iput-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    return-void
.end method

.method static synthetic a(Lcom/xingbook/park/view/d;)I
    .locals 1

    iget v0, p0, Lcom/xingbook/park/view/d;->f:I

    return v0
.end method

.method private a()V
    .locals 4

    const-wide/16 v2, 0x3e8

    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    iget v0, v0, Lcom/xingbook/park/view/e;->a:I

    if-nez v0, :cond_2

    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    const-wide/16 v1, 0x0

    invoke-virtual {v0, v1, v2}, Lcom/xingbook/park/view/e;->setDuration(J)V

    :cond_1
    :goto_1
    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    iget v1, p0, Lcom/xingbook/park/view/d;->f:I

    invoke-virtual {v0, v1}, Lcom/xingbook/park/view/e;->a(I)V

    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    invoke-virtual {v0, p0}, Lcom/xingbook/park/view/e;->setAnimationListener(Landroid/view/animation/Animation$AnimationListener;)V

    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    invoke-virtual {p0, v0}, Lcom/xingbook/park/view/d;->startAnimation(Landroid/view/animation/Animation;)V

    goto :goto_0

    :cond_2
    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    iget v0, v0, Lcom/xingbook/park/view/e;->a:I

    const/4 v1, 0x1

    if-ne v0, v1, :cond_3

    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    invoke-virtual {v0, v2, v3}, Lcom/xingbook/park/view/e;->setDuration(J)V

    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    new-instance v1, Landroid/view/animation/AccelerateInterpolator;

    invoke-direct {v1}, Landroid/view/animation/AccelerateInterpolator;-><init>()V

    invoke-virtual {v0, v1}, Lcom/xingbook/park/view/e;->setInterpolator(Landroid/view/animation/Interpolator;)V

    goto :goto_1

    :cond_3
    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    iget v0, v0, Lcom/xingbook/park/view/e;->a:I

    const/4 v1, 0x2

    if-ne v0, v1, :cond_1

    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    invoke-virtual {v0, v2, v3}, Lcom/xingbook/park/view/e;->setDuration(J)V

    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    new-instance v1, Landroid/view/animation/DecelerateInterpolator;

    invoke-direct {v1}, Landroid/view/animation/DecelerateInterpolator;-><init>()V

    invoke-virtual {v0, v1}, Lcom/xingbook/park/view/e;->setInterpolator(Landroid/view/animation/Interpolator;)V

    goto :goto_1
.end method

.method public static b(I)I
    .locals 3

    const/high16 v2, 0x3f00

    invoke-static {}, Landroid/content/res/Resources;->getSystem()Landroid/content/res/Resources;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v0

    iget v0, v0, Landroid/util/DisplayMetrics;->density:F

    if-gez p0, :cond_0

    neg-int v1, p0

    int-to-float v1, v1

    sub-float/2addr v1, v2

    div-float v0, v1, v0

    float-to-int v0, v0

    neg-int v0, v0

    :goto_0
    return v0

    :cond_0
    int-to-float v1, p0

    sub-float/2addr v1, v2

    div-float v0, v1, v0

    float-to-int v0, v0

    goto :goto_0
.end method


# virtual methods
.method public a(I)V
    .locals 2

    const/4 v1, 0x1

    iput p1, p0, Lcom/xingbook/park/view/d;->g:I

    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    iget v0, v0, Lcom/xingbook/park/view/e;->a:I

    if-eq v0, v1, :cond_0

    invoke-virtual {p0}, Lcom/xingbook/park/view/d;->clearAnimation()V

    :cond_0
    new-instance v0, Lcom/xingbook/park/view/e;

    invoke-direct {v0, p0}, Lcom/xingbook/park/view/e;-><init>(Lcom/xingbook/park/view/d;)V

    iput-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    iput v1, v0, Lcom/xingbook/park/view/e;->a:I

    const/16 v0, 0x64

    invoke-virtual {p0, v0}, Lcom/xingbook/park/view/d;->setPercent(I)V

    invoke-direct {p0}, Lcom/xingbook/park/view/d;->a()V

    return-void
.end method

.method public onAnimationEnd(Landroid/view/animation/Animation;)V
    .locals 2

    check-cast p1, Lcom/xingbook/park/view/e;

    iget v0, p1, Lcom/xingbook/park/view/e;->a:I

    packed-switch v0, :pswitch_data_0

    :cond_0
    :goto_0
    return-void

    :pswitch_0
    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    if-eqz v0, :cond_1

    invoke-virtual {p0}, Lcom/xingbook/park/view/d;->clearAnimation()V

    :cond_1
    new-instance v0, Lcom/xingbook/park/view/e;

    invoke-direct {v0, p0}, Lcom/xingbook/park/view/e;-><init>(Lcom/xingbook/park/view/d;)V

    iput-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    iget-object v0, p0, Lcom/xingbook/park/view/d;->k:Lcom/xingbook/park/view/e;

    const/4 v1, 0x2

    iput v1, v0, Lcom/xingbook/park/view/e;->a:I

    iget v0, p0, Lcom/xingbook/park/view/d;->g:I

    invoke-virtual {p0, v0}, Lcom/xingbook/park/view/d;->setPercent(I)V

    invoke-direct {p0}, Lcom/xingbook/park/view/d;->a()V

    goto :goto_0

    :pswitch_1
    iget-object v0, p0, Lcom/xingbook/park/view/d;->n:Lcom/xingbook/park/view/f;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/park/view/d;->n:Lcom/xingbook/park/view/f;

    invoke-interface {v0}, Lcom/xingbook/park/view/f;->a()V

    goto :goto_0

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method

.method public onAnimationRepeat(Landroid/view/animation/Animation;)V
    .locals 0

    return-void
.end method

.method public onAnimationStart(Landroid/view/animation/Animation;)V
    .locals 3

    check-cast p1, Lcom/xingbook/park/view/e;

    iget v0, p1, Lcom/xingbook/park/view/e;->a:I

    packed-switch v0, :pswitch_data_0

    :cond_0
    :goto_0
    return-void

    :pswitch_0
    iget-object v0, p0, Lcom/xingbook/park/view/d;->n:Lcom/xingbook/park/view/f;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/park/view/d;->n:Lcom/xingbook/park/view/f;

    iget v1, p0, Lcom/xingbook/park/view/d;->f:I

    iget v2, p0, Lcom/xingbook/park/view/d;->g:I

    invoke-interface {v0, v1, v2}, Lcom/xingbook/park/view/f;->a(II)V

    goto :goto_0

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
    .end packed-switch
.end method

.method protected onAttachedToWindow()V
    .locals 0

    invoke-super {p0}, Landroid/view/View;->onAttachedToWindow()V

    invoke-static {p0}, Lcom/xingbook/park/c/c;->b(Landroid/view/View;)V

    return-void
.end method

.method protected onDetachedFromWindow()V
    .locals 0

    invoke-super {p0}, Landroid/view/View;->onDetachedFromWindow()V

    invoke-static {p0}, Lcom/xingbook/park/c/c;->a(Landroid/view/View;)V

    return-void
.end method

.method protected onDraw(Landroid/graphics/Canvas;)V
    .locals 9

    const/high16 v8, 0x4000

    const/4 v1, 0x0

    iget-object v0, p0, Lcom/xingbook/park/view/d;->l:Landroid/graphics/PaintFlagsDrawFilter;

    invoke-virtual {p1, v0}, Landroid/graphics/Canvas;->setDrawFilter(Landroid/graphics/DrawFilter;)V

    iget v0, p0, Lcom/xingbook/park/view/d;->c:I

    int-to-float v3, v0

    iget v0, p0, Lcom/xingbook/park/view/d;->c:I

    int-to-float v4, v0

    const/4 v5, 0x0

    const/16 v6, 0x1f

    move-object v0, p1

    move v2, v1

    invoke-virtual/range {v0 .. v6}, Landroid/graphics/Canvas;->saveLayer(FFFFLandroid/graphics/Paint;I)I

    move-result v0

    iget v2, p0, Lcom/xingbook/park/view/d;->c:I

    div-int/lit8 v2, v2, 0x2

    int-to-float v3, v2

    iget v4, p0, Lcom/xingbook/park/view/d;->e:F

    div-float/2addr v4, v8

    sub-float/2addr v3, v4

    float-to-int v3, v3

    iget-object v4, p0, Lcom/xingbook/park/view/d;->j:Landroid/graphics/Paint;

    iget v5, p0, Lcom/xingbook/park/view/d;->a:I

    invoke-virtual {v4, v5}, Landroid/graphics/Paint;->setColor(I)V

    iget-object v4, p0, Lcom/xingbook/park/view/d;->j:Landroid/graphics/Paint;

    sget-object v5, Landroid/graphics/Paint$Style;->STROKE:Landroid/graphics/Paint$Style;

    invoke-virtual {v4, v5}, Landroid/graphics/Paint;->setStyle(Landroid/graphics/Paint$Style;)V

    iget-object v4, p0, Lcom/xingbook/park/view/d;->j:Landroid/graphics/Paint;

    sget-object v5, Landroid/graphics/Paint$Cap;->SQUARE:Landroid/graphics/Paint$Cap;

    invoke-virtual {v4, v5}, Landroid/graphics/Paint;->setStrokeCap(Landroid/graphics/Paint$Cap;)V

    iget-object v4, p0, Lcom/xingbook/park/view/d;->j:Landroid/graphics/Paint;

    iget v5, p0, Lcom/xingbook/park/view/d;->e:F

    invoke-virtual {v4, v5}, Landroid/graphics/Paint;->setStrokeWidth(F)V

    int-to-float v4, v2

    int-to-float v5, v2

    int-to-float v6, v3

    iget-object v7, p0, Lcom/xingbook/park/view/d;->j:Landroid/graphics/Paint;

    invoke-virtual {p1, v4, v5, v6, v7}, Landroid/graphics/Canvas;->drawCircle(FFFLandroid/graphics/Paint;)V

    iget-object v4, p0, Lcom/xingbook/park/view/d;->m:Landroid/graphics/RectF;

    sub-int v5, v2, v3

    int-to-float v5, v5

    iput v5, v4, Landroid/graphics/RectF;->left:F

    iget-object v4, p0, Lcom/xingbook/park/view/d;->m:Landroid/graphics/RectF;

    sub-int v5, v2, v3

    int-to-float v5, v5

    iput v5, v4, Landroid/graphics/RectF;->top:F

    iget-object v4, p0, Lcom/xingbook/park/view/d;->m:Landroid/graphics/RectF;

    add-int v5, v2, v3

    int-to-float v5, v5

    iput v5, v4, Landroid/graphics/RectF;->right:F

    iget-object v4, p0, Lcom/xingbook/park/view/d;->m:Landroid/graphics/RectF;

    add-int/2addr v2, v3

    int-to-float v2, v2

    iput v2, v4, Landroid/graphics/RectF;->bottom:F

    iget-object v2, p0, Lcom/xingbook/park/view/d;->j:Landroid/graphics/Paint;

    iget v3, p0, Lcom/xingbook/park/view/d;->b:I

    invoke-virtual {v2, v3}, Landroid/graphics/Paint;->setColor(I)V

    iget-object v3, p0, Lcom/xingbook/park/view/d;->m:Landroid/graphics/RectF;

    const/high16 v4, -0x3d4c

    iget v2, p0, Lcom/xingbook/park/view/d;->f:I

    mul-int/lit16 v2, v2, 0x168

    int-to-float v2, v2

    const/high16 v5, 0x42c8

    div-float v5, v2, v5

    const/4 v6, 0x0

    iget-object v7, p0, Lcom/xingbook/park/view/d;->j:Landroid/graphics/Paint;

    move-object v2, p1

    invoke-virtual/range {v2 .. v7}, Landroid/graphics/Canvas;->drawArc(Landroid/graphics/RectF;FFZLandroid/graphics/Paint;)V

    iget-object v2, p0, Lcom/xingbook/park/view/d;->n:Lcom/xingbook/park/view/f;

    if-eqz v2, :cond_0

    iget-object v2, p0, Lcom/xingbook/park/view/d;->n:Lcom/xingbook/park/view/f;

    iget v3, p0, Lcom/xingbook/park/view/d;->f:I

    invoke-interface {v2, v3}, Lcom/xingbook/park/view/f;->a(I)V

    :cond_0
    iget-object v2, p0, Lcom/xingbook/park/view/d;->j:Landroid/graphics/Paint;

    iget v3, p0, Lcom/xingbook/park/view/d;->h:F

    invoke-virtual {v2, v3}, Landroid/graphics/Paint;->setTextSize(F)V

    iget-object v2, p0, Lcom/xingbook/park/view/d;->j:Landroid/graphics/Paint;

    iget v3, p0, Lcom/xingbook/park/view/d;->i:I

    invoke-virtual {v2, v3}, Landroid/graphics/Paint;->setColor(I)V

    iget-object v2, p0, Lcom/xingbook/park/view/d;->j:Landroid/graphics/Paint;

    invoke-virtual {v2, v1}, Landroid/graphics/Paint;->setStrokeWidth(F)V

    iget-object v1, p0, Lcom/xingbook/park/view/d;->j:Landroid/graphics/Paint;

    sget-object v2, Landroid/graphics/Typeface;->DEFAULT:Landroid/graphics/Typeface;

    invoke-virtual {v1, v2}, Landroid/graphics/Paint;->setTypeface(Landroid/graphics/Typeface;)Landroid/graphics/Typeface;

    new-instance v1, Ljava/lang/StringBuilder;

    iget v2, p0, Lcom/xingbook/park/view/d;->f:I

    invoke-static {v2}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v2, "%"

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    iget-object v2, p0, Lcom/xingbook/park/view/d;->j:Landroid/graphics/Paint;

    invoke-virtual {v2, v1}, Landroid/graphics/Paint;->measureText(Ljava/lang/String;)F

    move-result v2

    iget-object v3, p0, Lcom/xingbook/park/view/d;->j:Landroid/graphics/Paint;

    invoke-virtual {v3}, Landroid/graphics/Paint;->getFontMetrics()Landroid/graphics/Paint$FontMetrics;

    move-result-object v3

    iget v4, p0, Lcom/xingbook/park/view/d;->d:I

    int-to-float v4, v4

    iget v5, v3, Landroid/graphics/Paint$FontMetrics;->descent:F

    sub-float/2addr v4, v5

    iget v3, v3, Landroid/graphics/Paint$FontMetrics;->ascent:F

    sub-float v3, v4, v3

    div-float/2addr v3, v8

    iget v4, p0, Lcom/xingbook/park/view/d;->c:I

    int-to-float v4, v4

    sub-float v2, v4, v2

    div-float/2addr v2, v8

    iget-object v4, p0, Lcom/xingbook/park/view/d;->j:Landroid/graphics/Paint;

    invoke-virtual {p1, v1, v2, v3, v4}, Landroid/graphics/Canvas;->drawText(Ljava/lang/String;FFLandroid/graphics/Paint;)V

    invoke-virtual {p1, v0}, Landroid/graphics/Canvas;->restoreToCount(I)V

    return-void
.end method

.method protected onMeasure(II)V
    .locals 4

    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getMode(I)I

    move-result v0

    invoke-static {p1}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v1

    invoke-static {p2}, Landroid/view/View$MeasureSpec;->getSize(I)I

    move-result v2

    const/high16 v3, 0x4000

    if-ne v0, v3, :cond_0

    iput v1, p0, Lcom/xingbook/park/view/d;->c:I

    iput v2, p0, Lcom/xingbook/park/view/d;->d:I

    :goto_0
    iget v0, p0, Lcom/xingbook/park/view/d;->c:I

    iget v1, p0, Lcom/xingbook/park/view/d;->d:I

    invoke-virtual {p0, v0, v1}, Lcom/xingbook/park/view/d;->setMeasuredDimension(II)V

    return-void

    :cond_0
    const/16 v0, 0x140

    invoke-static {v0}, Lcom/xingbook/park/view/d;->b(I)I

    move-result v0

    iput v0, p0, Lcom/xingbook/park/view/d;->c:I

    const/16 v0, 0x1e0

    invoke-static {v0}, Lcom/xingbook/park/view/d;->b(I)I

    move-result v0

    iput v0, p0, Lcom/xingbook/park/view/d;->d:I

    goto :goto_0
.end method

.method public setCallback(Lcom/xingbook/park/view/f;)V
    .locals 0

    iput-object p1, p0, Lcom/xingbook/park/view/d;->n:Lcom/xingbook/park/view/f;

    return-void
.end method

.method public setCircleArcRound(I)V
    .locals 1

    int-to-float v0, p1

    iput v0, p0, Lcom/xingbook/park/view/d;->e:F

    return-void
.end method

.method public setCircleBgColor(I)V
    .locals 0

    iput p1, p0, Lcom/xingbook/park/view/d;->a:I

    return-void
.end method

.method public setCircleProgressColor(I)V
    .locals 0

    iput p1, p0, Lcom/xingbook/park/view/d;->b:I

    return-void
.end method

.method public setPercent(I)V
    .locals 0

    iput p1, p0, Lcom/xingbook/park/view/d;->f:I

    invoke-virtual {p0}, Lcom/xingbook/park/view/d;->invalidate()V

    return-void
.end method
